import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/smart_warehouse/product_storage_entity.dart';

ProductStorageEntity $ProductStorageEntityFromJson(Map<String, dynamic> json) {
  final ProductStorageEntity productStorageEntity = ProductStorageEntity();
  final int? boxContent = jsonConvert.convert<int>(json['boxContent']);
  if (boxContent != null) {
    productStorageEntity.boxContent = boxContent;
  }
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    productStorageEntity.companyCode = companyCode;
  }
  final String? productId = jsonConvert.convert<String>(json['productId']);
  if (productId != null) {
    productStorageEntity.productId = productId;
  }
  final String? productLevel = jsonConvert.convert<String>(json['productLevel']);
  if (productLevel != null) {
    productStorageEntity.productLevel = productLevel;
  }
  final String? productName = jsonConvert.convert<String>(json['productName']);
  if (productName != null) {
    productStorageEntity.productName = productName;
  }
  final String? sadetyPersonName = jsonConvert.convert<String>(json['sadetyPersonName']);
  if (sadetyPersonName != null) {
    productStorageEntity.sadetyPersonName = sadetyPersonName;
  }
  final int? total = jsonConvert.convert<int>(json['total']);
  if (total != null) {
    productStorageEntity.total = total;
  }
  final String? warehouseId = jsonConvert.convert<String>(json['warehouseId']);
  if (warehouseId != null) {
    productStorageEntity.warehouseId = warehouseId;
  }
  final String? warehouseName = jsonConvert.convert<String>(json['warehouseName']);
  if (warehouseName != null) {
    productStorageEntity.warehouseName = warehouseName;
  }
  return productStorageEntity;
}

Map<String, dynamic> $ProductStorageEntityToJson(ProductStorageEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['boxContent'] = entity.boxContent;
  data['companyCode'] = entity.companyCode;
  data['productId'] = entity.productId;
  data['productLevel'] = entity.productLevel;
  data['productName'] = entity.productName;
  data['sadetyPersonName'] = entity.sadetyPersonName;
  data['total'] = entity.total;
  data['warehouseId'] = entity.warehouseId;
  data['warehouseName'] = entity.warehouseName;
  return data;
}

extension ProductStorageEntityExtension on ProductStorageEntity {
  ProductStorageEntity copyWith({
    int? boxContent,
    String? companyCode,
    String? productId,
    String? productLevel,
    String? productName,
    String? sadetyPersonName,
    int? total,
    String? warehouseId,
    String? warehouseName,
  }) {
    return ProductStorageEntity()
      ..boxContent = boxContent ?? this.boxContent
      ..companyCode = companyCode ?? this.companyCode
      ..productId = productId ?? this.productId
      ..productLevel = productLevel ?? this.productLevel
      ..productName = productName ?? this.productName
      ..sadetyPersonName = sadetyPersonName ?? this.sadetyPersonName
      ..total = total ?? this.total
      ..warehouseId = warehouseId ?? this.warehouseId
      ..warehouseName = warehouseName ?? this.warehouseName;
  }
}
